package com.yanqu.road.server.cmd.cookboy;

import com.yanqu.road.pb.cookboy.CookBoyProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.cookboy.CrossCookBoyMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;


@Cmd(code = Protocol.C_CROSS_COOK_BOY3_USER_LOGIN, desc = "登录同步一些东西")
public class CrossUserLoginCmd extends CrossCommand {

    int activityId;
    long userId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CookBoyProto.CrossCookBoy3LoginSyncMsg reqMsg = CookBoyProto.CrossCookBoy3LoginSyncMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        userId = reqMsg.getUserId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossCookBoyMgr.syncCookBoy3LoginData(activityId,serverId,userId);
    }

    @Override
    public void sendData() {

    }

}
